!wget https://raw.githubusercontent.com/awarischool/br-data-science/master/image-colorizer/deoldify_wrapper.py
--2022-07-01 00:25:40--  https://raw.githubusercontent.com/awarischool/br-data-science/master/image-colorizer/deoldify_wrapper.py
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.111.133, 185.199.109.133, 185.199.108.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.111.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2623 (2.6K) [text/plain]
Saving to: ‘deoldify_wrapper.py’

deoldify_wrapper.py 100%[===================>]   2.56K  --.-KB/s    in 0s      

2022-07-01 00:25:40 (30.4 MB/s) - ‘deoldify_wrapper.py’ saved [2623/2623]

from deoldify_wrapper import DeOldify
deo = DeOldify()
  Importing Libraries
No module named 'deoldify'
DeOldify not found, installing..
  Cloning DeOldify Repository...
  Opening DeOldify Folder
  Importing Libraries
/content/deoldify_wrapper.py:36: UserWarning: WARNING: GPU not available. Activate it on Colab at Edit > Notebook Settings
  warnings.warn('WARNING: GPU not available. Activate it on Colab at Edit > Notebook Settings')
  Installing Colab requirements...
  Importing DeOldify Visualize module and FastAI
  Downloading Colorizer Model
  Initializing Colorizer
/content/DeOldify/fastai/data_block.py:451: UserWarning: Your training set is empty. If this is by design, pass `ignore_empty=True` to remove this warning.
  warn("Your training set is empty. If this is by design, pass `ignore_empty=True` to remove this warning.")
/content/DeOldify/fastai/data_block.py:454: UserWarning: Your validation set is empty. If this is by design, use `split_none()`
                 or pass `ignore_empty=True` when labelling to remove this warning.
  or pass `ignore_empty=True` when labelling to remove this warning.""")
/usr/local/lib/python3.7/dist-packages/torch/utils/data/dataloader.py:490: UserWarning: This DataLoader will create 8 worker processes in total. Our suggested max number of worker in current system is 2, which is smaller than what this DataLoader is going to create. Please be aware that excessive worker creation might get DataLoader running slow or even freeze, lower the worker number to avoid potential slowness/freeze if necessary.
  cpuset_checked))
Downloading: "https://download.pytorch.org/models/resnet101-63fe2227.pth" to /root/.cache/torch/hub/checkpoints/resnet101-63fe2227.pth
Done!
url='https://pixabay.com/get/g410471a558d2ff83ea723758fc5bb8dc950f953993b63ee7f65432dcd0c07d1cd66e728a2f1a67843a3bd57e0cf0048c8bed42f20ea4444e9ab2edf061983906f5a2e6ebb1acb39562dbcc64be1c6d98_1920.jpg'
deo.colorize(url, render_factor=10)